/*
 * FXGL - JavaFX Game Library. The MIT License (MIT).
 * Copyright (c) AlmasB (almaslvl@gmail.com).
 * See LICENSE for details.
 */

package com.windea.study.kotlin.fxgl.sample.sandbox.view

import com.almasb.fxgl.app.*
import com.almasb.fxgl.dsl.*
import com.almasb.fxgl.dsl.components.view.*
import com.windea.study.kotlin.fxgl.sample.dev.*
import dev.*
import javafx.scene.input.*
import javafx.scene.paint.*
import javafx.scene.shape.*

/**
 * @author Almas Baimagambetov (almaslvl@gmail.com)
 */
class BasicEntityViewApp : GameApplication() {
	override fun initSettings(settings: GameSettings) {}
	
	override fun initInput() {
		onKeyDown(KeyCode.F, "test") {
			println(("Game time: " + getGameTimer().now))
		}
	}
	
	override fun initGame() {
		entityBuilder()
			.at(100.0, 100.0)
			.view(Rectangle(100.0, 100.0, Color.BLUE))
			.with(DeveloperWASDControl())
			.with(HealthBarViewComponent(0.0, 100.0))
			.buildAndAttach()
	}
}

fun main(args: Array<String>) {
	GameApplication.launch(BasicEntityViewApp::class.java, args)
}

